Skip to content

fix: List page crashes and missing rows#40

Closed
Cragsmann wants to merge 7 commits into
functions-dev:masterfrom
Cragsmann:SRVOCF-840--fix-list-page-crashes
Closed

fix: List page crashes and missing rows#40
Cragsmann wants to merge 7 commits into
functions-dev:masterfrom
Cragsmann:SRVOCF-840--fix-list-page-crashes

Conversation

@Cragsmann

@Cragsmann Cragsmann commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add per-repo error handling in loadFunctionTableItems so a deleted GitHub repo no longer crashes the entire list page (repos that fail to load are silently skipped)
  • Use function name from func.yaml instead of repo name as the correlation key, so cluster matching works when the two differ
  • Rename parseNamespaceAndRuntime to parseFuncYaml and extract the name field

Fixes SRVOCF-840

Test plan

  • Delete a function repo from GitHub, click Refresh on list page. Page shows remaining functions (or empty state) without crashing
  • Create a repo where func.yaml name differs from repo name. List page shows the func.yaml name and matches cluster status correctly
  • Unit tests pass (131 total, 5 new)

@Cragsmann Cragsmann changed the title SRVOCF-840: Fix list page crashes and missing rows fix: List page crashes and missing rows Jun 15, 2026
@matejvasek

matejvasek commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

via Claude:

Review

Blocking

Edit link breaks when func.yaml name differs from repo name.

The list page now uses the func.yaml name as the item name (FunctionsListPage.tsx:227: newItem(name || repo.name, ...)), and the edit link navigates using that name (FunctionsListPage.tsx:208: navigate(\/faas/edit/${name}`)`).

But resolveRepoContent in FunctionEditPage.tsx:193 looks up repos by GitHub repo name: repos.find((r) => r.name === repoName).

When func.yaml has name: my-function but the repo is named my-repo:

  1. List page shows my-function
  2. Clicking edit navigates to /faas/edit/my-function
  3. resolveRepoContent searches for a repo named my-function, finds nothing
  4. Edit page fails

The FunctionTableItem (or the edit route) needs to carry the repo name alongside the display name so that resolveRepoContent can resolve correctly.

Non-blocking

  • Silent error swallowing (FunctionsListPage.tsx:228-229): Bare catch drops all errors, not just 404s from deleted repos. Network timeouts and rate limits would silently hide repos with no indication to the user.

@Cragsmann

Copy link
Copy Markdown
Collaborator Author

Both issues confirmed and fixed:

1. Edit link (blocking): Added repoName field to FunctionTableItem. The edit button now passes fn.repoName (the GitHub repo name) instead of fn.name (the func.yaml display name), so resolveRepoContent resolves correctly even when they differ. Added a test covering the divergent-name case.

2. Silent error swallowing (non-blocking): Changed the bare catch to log via console.warn with the repo name and error message, so network timeouts and rate limits are visible instead of silently dropped.

@matejvasek

Copy link
Copy Markdown
Collaborator

Looks good to me.

@twoGiants are we OK with just logging the error for a developers into console,
or do we want error reported also to WebUI?

Comment thread src/pages/function-list/FunctionsListPage.tsx Outdated
@matejvasek

Copy link
Copy Markdown
Collaborator

plz update ./docs/claude-progress.txt

Cragsmann and others added 2 commits June 19, 2026 09:55
When fetchFileContent fails for a repo, return an error table
item instead of null. This surfaces the failure to the user
rather than silently hiding the repo from the list.

Co-Authored-By: Claude <noreply@anthropic.com>
@Cragsmann Cragsmann requested a review from matejvasek June 19, 2026 07:56
The list page now shows failed repos as error items
instead of dropping them. Update the test to expect
both items in the table and verify the failed repo
appears by name.

Co-Authored-By: Claude <noreply@anthropic.com>
if (!funcYaml) return '';

const { runtime } = parseNamespaceAndRuntime(funcYaml.content);
const { runtime } = parseFuncYaml(funcYaml.content);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may also throw if there is syntax error in func.yaml, which results in infinite "Loading sources…".

Screencast.From.2026-06-19.13-44-41.mp4

However feel free to create separate bugreport/pr for this if you want.

@matejvasek

matejvasek commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

This looks IMO good.

Two nits:

  • Claude suggested using em dash instead of <UNKNOWN> (AI loves them em dashes don't it 😄). Perhaps returning namespace/runtime as an empty string results in em dashes in the table automatically.
  • Should not we keep the logging to console for developers sake? wdyt?

}),
);
return items;
return results.filter((item): item is FunctionTableItem => item !== null);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we are returning nulls no more we might not need this filter.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue addresed in Openshift repo's PR openshift#4

Replace '<UNKNOWN>' with empty strings so TextOrDash
renders em dashes automatically. Add console.error
for developer debugging. Remove the null filter since
the catch block always returns an item now.

Co-Authored-By: Claude <noreply@anthropic.com>
@Cragsmann

Copy link
Copy Markdown
Collaborator Author

PR opened in Openshift repo openshift#4

@Cragsmann Cragsmann closed this Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants